package a.f.h.c;

import a.c.e;
import a.c.*;
import a.f.h.b.f;
import a.f.h.b.k;
import a.f.j.o;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class m
{
  protected f a;
  protected l b;
  protected l c;
  protected q d;
  protected x e;
  public static int f;
  
  public m(l paraml1, l paraml2)
  {
    this.b = paraml1;
    this.c = paraml2;
    g();
  }
  
  public void a(f paramf)
  {
    this.a = paramf;
  }
  
  public z a()
  {
    boolean bool = d.o;
    int i = d.n;
    z localz = new z();
    a.c.m localm = this.d.w();
    do
    {
      if (!localm.e()) {
        break;
      }
      a.c.d locald = localm.a();
      d[] arrayOfd = new d[2];
      arrayOfd[0] = a(locald.e());
      arrayOfd[1] = a(locald.f());
      if (!bool)
      {
        if (i != 0) {
          break label101;
        }
        localz.add(arrayOfd);
        localm.f();
      }
    } while (i == 0);
    label101:
    return localz;
  }
  
  public void b()
  {
    this.d = new q();
    this.e = this.d.B();
    a(this.b);
    a(this.c);
    a.i.n.a(this, 3, "-->> All Pair longest path");
    this.b.i();
    this.c.i();
    a.i.n.a(this, 3, "-->> Init Dependency Graph");
    d();
    a.i.n.a(this, 5, e());
  }
  
  protected d a(e parame)
  {
    return (d)this.e.get(parame);
  }
  
  protected boolean a(d paramd1, d paramd2)
  {
    boolean bool = d.o;
    if (!bool) {
      if (!this.b.b(paramd1, paramd2.g()))
      {
        if (bool) {
          break label81;
        }
        if (!this.b.b(paramd2.h(), paramd1))
        {
          if (bool) {
            break label81;
          }
          if (!this.c.b(paramd2, paramd1.g()))
          {
            if (bool) {
              break label83;
            }
            if (!this.c.b(paramd1.h(), paramd2)) {
              break label82;
            }
          }
        }
      }
    }
    label81:
    return true;
    label82:
    label83:
    return false;
  }
  
  public List b(d paramd1, d paramd2)
  {
    boolean bool = d.o;
    ArrayList localArrayList = new ArrayList(4);
    if (!bool) {
      if (!this.b.b(paramd2.g(), paramd1)) {
        localArrayList.add(new j(paramd1, paramd2.g(), this.b));
      }
    }
    if (!bool) {
      if (!this.b.b(paramd1, paramd2.h())) {
        localArrayList.add(new j(paramd2.h(), paramd1, this.b));
      }
    }
    if (!bool) {
      if (!this.c.b(paramd1.g(), paramd2)) {
        localArrayList.add(new j(paramd2, paramd1.g(), this.c));
      }
    }
    if ((bool) || (!this.c.b(paramd2, paramd1.h()))) {
      localArrayList.add(new j(paramd1.h(), paramd2, this.c));
    }
    return localArrayList;
  }
  
  protected boolean d(d paramd1, d paramd2)
  {
    boolean bool = d.o;
    List localList = b(paramd1, paramd2);
    if (!bool) {
      switch (localList.size())
      {
      case 0: 
        System.err.println("ERROR: No Possibilities to separate Segments: " + paramd1 + " " + paramd2);
        if (!bool) {
          if (d.n == 0) {
            break;
          }
        }
        break;
      case 1: 
        j localj = (j)localList.get(0);
        localj.a();
        return true;
      }
    }
    return false;
  }
  
  private void d()
  {
    boolean bool = d.o;
    int k = d.n;
    a locala = new a(this.b.g(), this.c.g());
    a.i.n.a(this, 3, "Init Dependency Matrix");
    z localz1 = new z();
    z localz2 = new z();
    boolean[] arrayOfBoolean1 = new boolean[this.c.g()];
    boolean[] arrayOfBoolean2 = new boolean[this.b.g()];
    Object localObject1 = this.a.c();
    label105:
    Object localObject3;
    label160:
    label162:
    label192:
    Object localObject4;
    d locald1;
    label326:
    Iterator localIterator1;
    label337:
    Iterator localIterator2;
    label363:
    do
    {
      do
      {
        if (!((o)localObject1).e()) {
          break;
        }
        localObject2 = ((o)localObject1).a();
        localz1.clear();
        do
        {
          localz2.clear();
          int j = 0;
          do
          {
            do
            {
              if (j >= arrayOfBoolean1.length) {
                break;
              }
              arrayOfBoolean1[j] = false;
              j++;
              if (bool) {
                break label162;
              }
              if (k != 0) {
                break label160;
              }
            } while (k == 0);
          } while (bool);
          j = 0;
          do
          {
            if (j >= arrayOfBoolean2.length) {
              break label192;
            }
            arrayOfBoolean2[j] = false;
            j++;
            if ((!bool) && (k != 0)) {
              break;
            }
          } while (k == 0);
          if (bool) {
            break label105;
          }
          localObject3 = ((a.f.j.n)localObject2).a();
          do
          {
            if (!((a.c.m)localObject3).e()) {
              break label326;
            }
            localObject4 = ((a.c.m)localObject3).a().e();
            locald1 = this.c.a((e)localObject4);
            if (k != 0) {
              break;
            }
            if (arrayOfBoolean1[locald1.c()] == 0)
            {
              localz2.add(locald1);
              arrayOfBoolean1[locald1.c()] = true;
            }
            locald1 = this.b.a((e)localObject4);
            if (!bool)
            {
              if (arrayOfBoolean2[locald1.c()] == 0)
              {
                localz1.add(locald1);
                arrayOfBoolean2[locald1.c()] = true;
              }
              ((a.c.m)localObject3).f();
            }
          } while (k == 0);
        } while (bool);
        localIterator1 = localz1.iterator();
        break label363;
        if (localIterator1.hasNext()) {}
        while (bool)
        {
          localObject3 = (d)localIterator1.next();
          localIterator2 = localz2.iterator();
          if (!localIterator2.hasNext()) {
            break label337;
          }
          localObject4 = (d)localIterator2.next();
          locala.a(((d)localObject3).c(), ((d)localObject4).c(), 1);
          if ((bool) || (bool)) {
            break label442;
          }
          if (k != 0) {
            break label440;
          }
          if (bool) {
            break label442;
          }
          if (k != 0) {
            break label440;
          }
          if (k == 0) {
            break;
          }
        }
        ((o)localObject1).f();
      } while (k == 0);
    } while (bool);
    label440:
    label442:
    localObject1 = this.a.a().v();
    do
    {
      if (!((w)localObject1).e()) {
        break;
      }
      localObject2 = ((w)localObject1).d();
      locala.a(this.b.a((e)localObject2).c(), this.c.a((e)localObject2).c(), 0);
      ((w)localObject1).f();
    } while (k == 0);
    localObject1 = this.d.w();
    ((a.c.m)localObject1).i();
    do
    {
      if (!((a.c.m)localObject1).e()) {
        break;
      }
      localObject2 = ((a.c.m)localObject1).a();
      if (!bool)
      {
        if (k != 0) {
          break label589;
        }
        this.d.a((a.c.d)localObject2);
        ((a.c.m)localObject1).g();
      }
    } while (k == 0);
    label589:
    label596:
    label602:
    label624:
    do
    {
      localIterator1 = this.b.e();
      break label624;
      break label624;
      if (!localIterator1.hasNext()) {
        break;
      }
      localObject2 = (d)localIterator1.next();
      localIterator2 = this.c.e();
      do
      {
        if (!localIterator2.hasNext()) {
          break label596;
        }
        localObject3 = (d)localIterator2.next();
        if (locala.a(((d)localObject2).c(), ((d)localObject3).c()) != 1) {
          break;
        }
        if (bool) {
          break label709;
        }
        this.d.a(((d)localObject2).a(), ((d)localObject3).a());
        if (bool) {
          break label602;
        }
        if (k != 0) {
          break label705;
        }
      } while (bool);
    } while (k == 0);
    label705:
    label709:
    Object localObject2 = this.d.w();
    do
    {
      if (!((a.c.m)localObject2).e()) {
        break;
      }
      localObject3 = ((a.c.m)localObject2).a();
      localObject4 = a(((a.c.d)localObject3).e());
      locald1 = a(((a.c.d)localObject3).f());
      if (k != 0) {
        break label800;
      }
      if (a((d)localObject4, locald1)) {
        this.d.a((a.c.d)localObject3);
      }
      ((a.c.m)localObject2).f();
    } while (k == 0);
    a.i.n.a(this, 3, "Check for simple Extensions");
    label800:
    int i = 1;
    break label819;
    if (i != 0) {
      label804:
      i = 0;
    }
    label819:
    while (bool)
    {
      d locald2;
      do
      {
        localObject3 = this.d.w();
        if (!((a.c.m)localObject3).e()) {
          break;
        }
        localObject4 = ((a.c.m)localObject3).a();
        locald1 = a(((a.c.d)localObject4).e());
        locald2 = a(((a.c.d)localObject4).f());
      } while (bool);
      if (k != 0) {
        break label804;
      }
      if (d(locald1, locald2))
      {
        i = 1;
        this.d.a((a.c.d)localObject4);
      }
      ((a.c.m)localObject3).f();
      if (k == 0) {
        break;
      }
    }
  }
  
  private void a(l paraml)
  {
    int i = d.n;
    Iterator localIterator = paraml.e();
    do
    {
      if (!localIterator.hasNext()) {
        break;
      }
      d locald = (d)localIterator.next();
      e locale = this.d.i();
      locald.c(locale);
      this.e.a(locale, locald);
    } while (i == 0);
  }
  
  public String e()
  {
    boolean bool = d.o;
    int i = d.n;
    StringBuffer localStringBuffer = new StringBuffer();
    localStringBuffer.append("Dependencies: ");
    y localy = a().h();
    do
    {
      if (!localy.e()) {
        break;
      }
      d[] arrayOfd = (d[])localy.j();
      if (!bool)
      {
        if (i != 0) {
          break label111;
        }
        localStringBuffer.append(arrayOfd[0] + " -> " + arrayOfd[1] + "\n");
        localy.f();
      }
    } while (i == 0);
    label111:
    return localStringBuffer.toString();
  }
  
  private void g()
  {
    a(this.b, this.c);
    a(this.c, this.b);
  }
  
  private void a(l paraml1, l paraml2)
  {
    int i = d.n;
    Iterator localIterator = paraml1.e();
    do
    {
      if (!localIterator.hasNext()) {
        break;
      }
      d locald = (d)localIterator.next();
      y localy = locald.k().h();
      e locale1 = (e)localy.j();
      localy.i();
      e locale2 = (e)localy.j();
      locald.a(paraml2.a(locale1), paraml2.a(locale2));
    } while (i == 0);
  }
  
  public static int a(f paramf, l paraml1, l paraml2)
  {
    boolean bool = d.o;
    int j = d.n;
    int i = 0;
    a.c.m localm = paramf.a().w();
    do
    {
      if (!localm.e()) {
        break;
      }
      a.c.d locald = localm.a();
      if (j != 0) {
        break label165;
      }
      d locald1;
      d locald2;
      if (paramf.i(locald).c(k.b))
      {
        locald1 = paraml1.a(locald.e());
        locald2 = paraml1.a(locald.f());
        i = i + locald2.l() - locald1.l();
      }
      if (!bool)
      {
        if (paramf.i(locald).c(k.c))
        {
          locald1 = paraml2.a(locald.e());
          locald2 = paraml2.a(locald.f());
          i = i + locald2.l() - locald1.l();
        }
        localm.f();
      }
    } while (j == 0);
    label165:
    return i;
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.f.h.c.m

 * JD-Core Version:    0.7.0.1

 */